﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bzure.Common.Core
{
    public interface ILastUpdate
    {
        /// <summary>
        /// 该时间值在被提交到数据持久化时候可能会被系统修改
        /// </summary>
        DateTime LastTime { get; set; }
    }
    public interface ICreateTime
    {
        /// <summary>
        /// 该时间值在被提交到数据持久化时候可能会被系统修改
        /// </summary>
        DateTime CreateTime { get; set; }
    }

    [Serializable]
    public class TimeStampEntity : Entity, ICreateTime, ILastUpdate
    {
        public TimeStampEntity()
        {
            this.CreateTime = DateTime.Now;
            this.LastTime = DateTime.Now;
        }
        public DateTime CreateTime { get; set; }
        public DateTime LastTime { get; set; }
    }
    [Serializable]
    public class TimeStampTemplateEntity : TemplateEntity, ICreateTime, ILastUpdate
    {
        public TimeStampTemplateEntity()
        {
            this.CreateTime = DateTime.Now;
            this.LastTime = DateTime.Now;
        }
        public DateTime CreateTime { get; set; }
        public DateTime LastTime { get; set; }
    }
}
